<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<script>
$(function(){
	$("ul.pagination li.disabled a").click(function(){
		return false;
	});
});
</script>
<!-- Bootstrap分页 -->
<nav>
	<ul class="pagination"> 
		<!-- 首页 -->
		<li <c:if test="${!page.hasPreviouse}"> class="disabled" </c:if>>
			<a href="?page.start=0${page.param}" aria-label="Previous">
				<span aria-hidden="true">«</span>
			</a>
		</li>
		
		<!-- 上一页 -->
		<li <c:if test="${!page.hasPreviouse}">class="disabled"</c:if>>
			<a href="?page.start=${page.start-page.count}${page.param}" aria-label="Previous">
				<span aria-hidden="true">‹</span>
			</a>
		</li>
		
		<!-- 中间页 -->
		<c:forEach begin="0" end="${page.totalPage-1}" varStatus="status">
			<c:if test="${status.count*page.count-page.start<=20 && status.count*page.count-page.start>=-10}">
				<li <c:if test="${status.index*page.count==page.start}"> class="disabled" </c:if>>
					<a href="?page.start=${status.index*page.count}${page.param}" <c:if test="${status.index*page.count==page.start}"> class="current"</c:if>>
						${status.count}
					</a>
				</li>
			</c:if>
		</c:forEach>
		
		<!-- 下一页 -->
		<li <c:if test="${!page.hasNext}" >class="disabled" </c:if>>
			<a href="?page.start=${page.start+page.count}${page.param}" aria-label="Next">
				<span aria-hidden="true">›</span>
			</a>
		</li>
		
		<!-- 尾页 -->
		<li <c:if test="${!page.hasNext}">class="disabled"</c:if>>
      		<a href="?page.start=${page.last}${page.param}" aria-label="Next">
        		<span aria-hidden="true">»</span>
      		</a>
    	</li>
	</ul>
</nav>

